package com.changil.admin.action.user;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.changil.admin.action.Action;
import com.changil.admin.protocol.http.HttpUtil;

public class LogOutAction extends Action {

	@Override
	public void execute(HttpServletRequest request, HttpServletResponse response)
			throws IOException, ServletException {
		HttpSession session = request.getSession(false);
		if(session != null)
		{
			session.removeAttribute("authUser");
			session.invalidate();
		}
		
		HttpUtil.redirect(response, "/NowonChangilChurch_Admin/main");

	}

}
